package com.hzqy.persistence.dao.workOrders;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.hzqy.persistence.dao.core.PersistenceDao;
import com.hzqy.web.vo.CmContentVo;
import com.hzqy.web.vo.workOrder.WorkOrderVo;
@Repository
public class WorkOrderDao extends PersistenceDao<WorkOrderVo, Integer>{
	
	public int insertWorkOrder(WorkOrderVo workOrderVo){
		return getSqlSession().insert(this.getNamespace()+"insertWorkOrder", workOrderVo);
	}
	
	public int findWorkOrderCount(WorkOrderVo workOrderVo) {
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "findWorkOrderCount", workOrderVo);
	}
	public List<CmContentVo> findWorkOrderList(Map<String,Object> map){
		String namespace = this.getNamespace();
		return getSqlSession().selectList(namespace + "findWorkOrderList", map);
	}
	public int reviewWorkOrder(WorkOrderVo workOrderVo){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "reviewWorkOrder", workOrderVo);
	}
	
	public WorkOrderVo selectWorkOrder(WorkOrderVo workOrderVo){
		String namespace = this.getNamespace();
		return getSqlSession().selectOne(namespace + "selectWorkOrder", workOrderVo);
	}
	public int updateWorkOrder(WorkOrderVo workOrderVo){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "updateWorkOrder", workOrderVo);
	}
	public int updateWorkOrderTwo(WorkOrderVo workOrderVo){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "updateWorkOrderTwo", workOrderVo);
	}
	public int deleteWorkOrder(int f_wo_id){
		String namespace = this.getNamespace();
		return getSqlSession().update(namespace + "deleteWorkOrder", f_wo_id);
	}
}
